Repository navigation
feat(maven-plugin): add posthog-maven-plugin to upload jvm sources with hog - #1011
ablaszkiewicz wants to merge 15 commits into
Conversation
The upload-sources goal runs posthog-cli jvm upload on the project's sources and the source directories of kotlin-maven-plugin, and packages the id they were uploaded under in posthog-meta.properties, which posthog-server reads. The release version defaults to the git commit. When posthog-cli is missing or too old, or no credentials are set, the goal skips with a warning unless requireUpload is set. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FkuJA9vNowLRRGH1hbFyhv
|
@PostHog review --deep |
|
@ablaszkiewicz PostHog Review is reviewing this pull request. |
PostHog Review · Deep · reviewed
|
| Step | Status | Result |
|---|---|---|
| Prepare the diff | done | 14 files, 2 chunks |
| Pick perspectives | done | 3 perspectives |
| Run review passes | done | 7 issues (+2 blind-spot) |
| Merge overlapping findings | done | 9 → 9 |
| Validate findings | done | 4 kept, 5 dismissed |
| Publish | done | 4 posted (view review) |
There was a problem hiding this comment.
See this review and its findings in PostHog Review.
- Run upload-sources in process-classes, after compilation, so the sources that annotation processors generate are uploaded. The id goes straight into the classes directory, because process-resources has already run. - Upload UTF-8 copies of Java sources whose declared encoding is not UTF-8. posthog-cli reads every file as UTF-8 and skips the others. - Put the CLI's directory and node's directory on the child PATH, so an npm launcher found outside PATH can start node. - On Windows, run the native binary of the npm package instead of its .cmd shim, so no argument passes through cmd. When only the shim can run, refuse values that hold cmd operators. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FkuJA9vNowLRRGH1hbFyhv
Parentheses start no command in cmd, and versions such as 1.0(5) hold them. Refuse the same characters as the Gradle plugin. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FkuJA9vNowLRRGH1hbFyhv
PR overviewAdds a PostHog Maven plugin to upload JVM sources with hog, including UTF-8 staging for sources using other encodings. One issue has been addressed, and one remains open in source staging. When staging is enabled for non-UTF-8 sources, Java or Kotlin symlinks can cause unrelated local files to be copied into the upload, potentially exposing credentials or other files outside the source tree. Exploitation requires a source symlink and a build configured to use staging. Open issues (1)
Fixed/addressed: 1 · PR risk: 6/10 Reviews |
Without the native binary, the plugin ran the bare name through cmd, and cmd looks in the project directory before PATH. The plugin now treats the shim as no install, so the build skips or fails with the install hint. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FkuJA9vNowLRRGH1hbFyhv
posthog-cli now uploads the sources without a release, so unchanged sources in a new release reuse the existing upload, and writes the release id into posthog-meta.properties for posthog-server to send with each exception. The README, the goal's javadoc and the changeset now say so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FkuJADQzM8ma8T9RauvMg5
dustinbyrne
left a comment
There was a problem hiding this comment.
Clean pure-Java, zero-runtime-dependency Maven plugin design; we verified locally with Apache Maven 3.9.11 (JDK 17.0.16) that the generated META-INF/maven/plugin.xml, <packaging>maven-plugin</packaging> POM, process-classes execution, and <pluginManagement> compiler encoding inheritance work end-to-end.
Leaving a COMMENT review for one breaking bug and a few concerns to address before approval:
- Breaking:
Utf8Sources.copydoes not normalize paths (.,..), which breaks thetarget//utf8-sources/skip guard and causes self-copying with mojibake corruption. - Concerns: release sequencing while
PostHog/posthog#144749andPostHog/posthog-android#1019are still open drafts; missing automatedMETA-INF/maven/plugin.xml/ Maven packaging test; contradictory multi-modulesourceRootsguidance inposthog-maven-plugin/README.md; Windows JDK 8–17 unset encoding skipping UTF-8 transcoding; and asymmetric behavior for missing explicit<sourceRoots>withrequireUpload=truevs empty existingsrc/main/javaonce credentials are set. - Follow-up (outside this repo): once
posthog-cli,posthog-server, andposthog-maven-pluginrelease, add JVM Maven source-upload documentation inPostHog/posthog.com(contents/docs/error-tracking/upload-source-maps/andcontents/docs/libraries/java/index.mdx), and optionally addposthog-maven-plugintoRELEASING.mdand rootCHANGELOG.md.
AI-assisted review.
…load A failed upload failed the build even without requireUpload, so a PostHog outage, a revoked key or rate limiting broke deploys. It now warns and ships no id. Local builds uploaded too, so a developer who ran posthog-cli login uploaded work in progress on every mvn test or mvn install, and could not build offline. Without requireUpload, the goal now uploads only from a CI build, not offline, and not in a module that another module of the build depends on, whose posthog-meta.properties could replace the application's on the classpath. requireUpload uploads from every build and fails it when the upload can't run, for deploy builds such as a Dockerfile. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FkuJADQzM8ma8T9RauvMg5
- Normalize source roots, so ${project.basedir}/. no longer makes the
UTF-8 copy walk into the build directory and copy itself.
- Add additionalSourceRoots, which adds to the default roots, for the
other modules of a multi-module build. sourceRoots still replaces
them.
- A configured source root that does not exist warns, and fails a
required upload.
- An unset source encoding falls back to the platform charset, which
javac also uses, so windows-1252 sources on Java 17 get UTF-8 copies.
- The help probe calls the CLI too old only when clap rejects the
command, and otherwise reports the exit code and first output line.
- Resolve a relative cliExecutable against the project, report a
configured path that does not exist, look for the CLI in nvm, strip
quotes from Windows PATH entries, and refuse a cmd line that would
cut a path with spaces short.
- Compile with --release 8, and test the generated plugin.xml in the
jar.
- Test the session checks through two hooks instead of the deprecated
MavenSession constructor.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FkuJADQzM8ma8T9RauvMg5
|
Thanks for the thorough review. Every inline point is addressed in f82d858, with a reply on each thread. The PR is back in draft until |
…upload-sources-hog
The upload-sources goal now runs `hog error-tracking process --kind jvm` instead of `posthog-cli jvm upload`, since only hog has the command. - Find hog the way the Android Gradle plugin does: PATH, then ~/.local/bin, nvm, /usr/local/bin and /opt/homebrew/bin, then the project's node_modules/.bin when node is installed. On Windows, search PATH with PATHEXT as cmd does, then ~/.local/bin/hog.exe, and run the hog.exe of the npm platform package instead of the hog.cmd shim. - Pass the dotenv file as HOG_DOTENV_FILE. - A missing hog skips with the install commands. Exit 3 skips as missing credentials, and exit 2, which an older hog returns for --kind jvm and --meta-out, skips with a `hog upgrade` hint. Every failure fails the build only when requireUpload is set. - Drop the plugin's deletes of posthog-meta.properties after a failed run, which hog guarantees. Keep the delete for builds that never start hog, and keep the UTF-8 copies, because hog skips non-UTF-8 files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rename PostHogCli to Hog, the cliExecutable parameter to hogExecutable (property posthog.hogExecutable), and the tests and helpers that named the CLI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Call the tool hog without code formatting, keep code formatting for the `hog error-tracking process` command and `posthog.hogExecutable`, and list credentials as a requirement instead of only a personal API key, since hog also logs in with a CI job's OIDC token or `hog auth login`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- One blank-string helper, Hog.isBlank, instead of four copies. - One environment key lookup behind pathKey and variable. - One cmd rejection message, and firstUnsafeForCmd takes the executable and its arguments. - Both hog exit codes in Hog, one branch for every non-zero exit with the `hog upgrade` hint only for exit 2, and a shorter credentials message. - skipOrFail(String), metaPropertiesFile() and home() helpers, and hog resolved from the mojo's environment field. - Look node up once for a project launcher. - Decode with new String, which already replaces unmappable bytes, and create the target folder once per copied file. - Tests: an assertThrows helper for required uploads, one helper that writes executable scripts, the meta file name from the constant, and no duplicate success test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Run `hog --version` before the upload. posthog-cli, or a hog older than MIN_HOG_VERSION (1.1.0, the first release with `hog error-tracking bundle`), skips the upload with a warning that says how to install or update hog, and fails it with requireUpload. The upload never runs with either. Versions compare numerically and ignore a prerelease suffix, and output without a version counts as too old. The exit 2 hint stays as a fallback. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The UTF-8 copies keep only Java and Kotlin files, so hog can't see the build files that mark a build output folder inside a copy. A broad root with a non-UTF-8 encoding could then upload generated sources that the same build without the copy skips. The copy now applies hog's folder skips to the original tree: hidden folders, node_modules, test source sets under src, and build, target and out folders next to a build file or src. A root is always copied. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A module counted as a library whenever another module of the build depended on it, so an application with an integration test, coverage or distribution module skipped the upload in CI with only an info line. Only a dependent module that runs the goal on sources of its own makes a module a library now. - A failed UTF-8 copy warns instead of failing a build whose upload is optional. - The UTF-8 copies keep a Java file that is valid UTF-8 already, so the sources of a module with another encoding stay readable. - The version check finds the version below a launcher warning on stderr. - The README says how a dotenv path resolves in a multi-module build, how a generated timestamp defeats reuse, and that hog now keeps a file that isn't UTF-8. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| throws IOException { | ||
| String name = file.getFileName().toString(); | ||
| boolean java = name.endsWith(".java"); | ||
| if (!java && !name.endsWith(".kt")) { |
There was a problem hiding this comment.
Medium: UTF-8 staging follows source symlinks
When a non-UTF-8 encoding enables staging, walkFileTree passes symlinks to this visitor and readAllBytes/Files.copy dereference them, so a .java or .kt link to an unrelated local file becomes a regular staged file submitted for upload. Reject non-regular entries using the supplied no-follow attributes before reading or copying to prevent credentials or other files outside the source tree from being included.
| if (!java && !name.endsWith(".kt")) { | |
| if (!attributes.isRegularFile() || (!java && !name.endsWith(".kt"))) { |
There was a problem hiding this comment.
Breaking: Confirming this as a blocking issue before approval, with two additional impacts beyond copying an external file:
- Bypasses
hog's explicit symlink defenses:hogintentionally skips symlinks during discovery (PostHog/posthoghog/src/error-tracking/discover.ts:133-161,Dirent.isFile()) and refuses them withlstat+O_NOFOLLOWinhog-worker(hog/worker/src/sources.rs:394-427). Materializing a.java/.ktsymlink as a regular file insidetarget/posthog/utf8-sources/defeats both guards. - Broken symlinks abort the entire upload: A dangling
.java/.ktsymlink throwsNoSuchFileExceptionat line 98/100 and abortsUtf8Sources.copy(failing the build whenrequireUpload=true), whereashogskips symlinks cleanly.
Executed verification (head 211887ec, JDK 17.0.16, Gradle 9.9.2, macOS arm64):
- Valid
.java/.ktsymlinks to../secret.envwere materialized as regular files intarget/posthog/utf8-sources/0/com/acme/Leak.java(finding2a_utf8CopiesSkipSymlinksfailed; positive controlApp.javapassed). - A broken
Broken.javasymlink threwjava.nio.file.NoSuchFileExceptionatUtf8Sources.java:98(finding2b_utf8CopiesDoNotCrashOnBrokenSymlinkfailed).
@Test
public void utf8CopiesSkipSymlinksAndBrokenSymlinks() throws Exception {
assumeUnix();
File secret = new File(temp.getRoot(), "secret.env");
Files.write(secret.toPath(), "SECRET_TOKEN=top-secret\n".getBytes(StandardCharsets.UTF_8));
File javaDir = sourceRoot("src/main/java/com/acme");
Files.write(
new File(javaDir, "App.java").toPath(),
"package com.acme;\n// caf\u00e9\nclass App {}\n".getBytes(StandardCharsets.ISO_8859_1));
Files.createSymbolicLink(new File(javaDir, "Leak.java").toPath(), secret.toPath());
Files.createSymbolicLink(new File(javaDir, "Leak.kt").toPath(), secret.toPath());
Files.createSymbolicLink(
new File(javaDir, "Broken.java").toPath(),
new File(temp.getRoot(), "missing-target.java").toPath());
File copy =
Utf8Sources.copy(
Collections.singletonList(new File(basedir, "src/main/java")),
StandardCharsets.ISO_8859_1,
new File(basedir, "target/posthog/utf8-sources"),
new File(basedir, "target"))
.get(0);
assertTrue(new File(copy, "com/acme/App.java").isFile());
assertFalse(new File(copy, "com/acme/Leak.java").exists());
assertFalse(new File(copy, "com/acme/Leak.kt").exists());
assertFalse(new File(copy, "com/acme/Broken.java").exists());
}Consider applying the !attributes.isRegularFile() guard above and adding the regression test covering both valid and broken symlinks.
AI-assisted review.
dustinbyrne
left a comment
There was a problem hiding this comment.
Thanks for addressing every item from the earlier review and migrating cleanly to hog 1.1.0 — the 44 unit tests (including the META-INF/maven/plugin.xml jar descriptor test) and generated <packaging>maven-plugin</packaging> POM look great.
Leaving a COMMENT review for two breaking issues and two concerns before approval:
- Breaking: On Windows,
versionProblem()spawnscmd /c <executable> --versionbeforeHog.firstUnsafeForCmd()runs (UploadSourcesMojo.java:177inline). - Breaking:
Utf8Sources.copydereferences.java/.ktsymlinks into regular staged files (bypassinghog'sO_NOFOLLOWsymlink boundary) and crashes on broken symlinks — replied directly on open thread #1011 (comment) (Utf8Sources.java:91). - Concern:
uploadsOwnSources()ignores<skip>true</skip>,<posthog.skip>true</posthog.skip>, and<phase>none</phase>on downstream modules (UploadSourcesMojo.java:283inline). - Concern (release sequencing — referencing resolved thread #7):
hog/v1.1.0is now released, but companionposthog-serverPR #1019 (8633d1b8) is still an open draft andposthog-maven-plugin/README.md:12still leaves the minimumposthog-serverversion unpinned. Because.github/workflows/release.ymlversions and publishes all pending.changeset/*.mdfiles together, consider holding merge (or keeping#1011in draft) until#1019is ready to ship before/with it and pinning the concreteposthog-serverminimum version inposthog-maven-plugin/README.md:12. - Suggestions: Two small parity cleanups with
hog/#1012inline (Utf8Sources.java:40*Testsuffix rule andUploadSourcesMojo.java:234exit-2/exit-3 hints). - Follow-up (post-release, outside this PR): Publish JVM Maven source-upload documentation in
PostHog/posthog.comonce#1019and#1011release (and optionally addposthog-maven-plugintoRELEASING.md).
AI-assisted review.
|
|
||
| String versionProblem; | ||
| try { | ||
| versionProblem = versionProblem(executable, isWindows, installHint); |
There was a problem hiding this comment.
Breaking: On Windows, versionProblem() invokes cmd /c <executable> --version before Hog.firstUnsafeForCmd() runs at lines 194–211, bypassing the cmd safety check for executable.
Trigger → actual → expected: When executable does not end with .exe (for example a PATH-resolved or configured hog.cmd shim under a path like C:\Users\R&D\...\hog.cmd, or a bare posthog.hogExecutable containing & such as hog&whoami), line 177 calls versionProblem() → start() → Hog.commandLine(), spawning cmd /c <executable> --version before lines 194–211 ever execute. Expected: Hog.firstUnsafeForCmd / Hog.cmdSplitsPath runs before any cmd /c invocation (including --version), matching companion PR #1012 (PostHogCliExecTask.kt:191-203).
Executed verification (head 211887ec, JDK 17.0.16, Gradle 9.9.2, macOS arm64; control_normalUploadPasses passed): Setting os.name=Windows 11 and mojo.hogExecutable = "hog&whoami" logged [debug] Running cmd /c hog&whoami --version and failed with Could not run hog (hog&whoami)... instead of "would not pass this value unchanged: hog&whoami". An existing .../R&D/hog.cmd passes isInstalledAt() (line 163) and hits the same versionProblem() → cmd /c path before line 194.
@Test
public void cmdUnsafeExecutableIsRejectedBeforeVersionProbe() throws Exception {
mojo.project.addCompileSourceRoot(sourceRoot("src/main/java").getAbsolutePath());
File unsafeShim = executable(new File(temp.newFolder("R&D"), "hog.cmd"), "@echo 1.1.0\r\n");
String previousOs = System.getProperty("os.name");
System.setProperty("os.name", "Windows 11");
try {
for (String candidate : Arrays.asList("hog&whoami", unsafeShim.getAbsolutePath())) {
mojo.hogExecutable = candidate;
String message = requiredUploadFailure().getMessage();
assertTrue(message, message.contains("would not pass this value unchanged: " + candidate));
}
} finally {
if (previousOs == null) {
System.clearProperty("os.name");
} else {
System.setProperty("os.name", previousOs);
}
}
}Consider moving the Hog.runsThroughCmd / firstUnsafeForCmd / cmdSplitsPath check ahead of versionProblem() (or into a helper called before every start()), optionally also rejecting executable values containing both spaces and cmd unquote characters &<>()@^| (matching #1012 Utils.kt:445-448), and adding the regression test above.
| return false; | ||
| } | ||
| boolean runsGoal = false; | ||
| for (PluginExecution execution : plugin.getExecutions()) { |
There was a problem hiding this comment.
Concern: uploadsOwnSources() treats any downstream module that declares an upload-sources execution as uploading, even when that module explicitly disables the goal with <skip>true</skip>, <posthog.skip>true</posthog.skip>, or <phase>none</phase>.
Trigger → actual → expected: When posthog-maven-plugin is configured in a shared parent POM and a downstream module (such as an integration-test or JMH module with helper classes under src/main/java) disables the plugin using <skip>true</skip>, <properties><posthog.skip>true</posthog.skip></properties>, or <phase>none</phase>, uploadsOwnSources() still returns true. The application module then skips its upload in CI while the downstream module also skips, so neither module uploads and the application ships without posthog-meta.properties. Expected: a downstream module whose upload-sources execution is skipped or bound to phase=none does not suppress the application's upload.
Executed verification (head 211887ec, JDK 17.0.16, Gradle 9.9.2): With downstream modules configured with <skip>true</skip>, <phase>none</phase>, and posthog.skip=true, mojo.execute() logged Skipping the PostHog source upload: demo-it-skip depends on this module and uploads its own sources... and wrote no posthog-meta.properties.
@Test
public void uploadsWhenDependentModulesSkipOrDisableTheGoal() throws Exception {
assumeUnix();
mojo.project.addCompileSourceRoot(sourceRoot("src/main/java").getAbsolutePath());
mojo.hogExecutable = fakeHog(0, true).getAbsolutePath();
MavenProject skippedByConfig = dependentModule("demo-it-skip", true);
Xpp3Dom config = new Xpp3Dom("configuration");
Xpp3Dom skip = new Xpp3Dom("skip");
skip.setValue("true");
config.addChild(skip);
skippedByConfig.getPlugin("com.posthog:posthog-maven-plugin").setConfiguration(config);
MavenProject disabledByPhase = dependentModule("demo-it-phase-none", true);
disabledByPhase.getPlugin("com.posthog:posthog-maven-plugin").getExecutions().get(0).setPhase("none");
MavenProject skippedByProperty = dependentModule("demo-it-prop", true);
skippedByProperty.getProperties().setProperty("posthog.skip", "true");
mojo.dependents = Arrays.asList(skippedByConfig, disabledByPhase, skippedByProperty);
mojo.execute();
assertTrue(metaProperties().isFile());
}Consider filtering executions in uploadsOwnSources() to ignore "none".equalsIgnoreCase(execution.getPhase()) and effective skip=true (checking execution config <skip>, then plugin config <skip>, then module.getProperties().getProperty("posthog.skip")), with a regression test covering all three opt-outs.
| "settings.gradle.kts", | ||
| "build.sbt", | ||
| "build.xml"); | ||
| private static final List<String> TEST_SOURCE_SETS = |
There was a problem hiding this comment.
Suggestion: Consider matching hog's *Test suffix rule instead of hardcoding four test source-set names, which both simplifies this code and keeps parity with hog and #1012.
In PostHog/posthog (hog/src/error-tracking/jvm.ts:39-41) and companion PR #1012 (Utf8Sources.kt:73), any directory under src matching name == "test" || name == "testFixtures" || name.endsWith("Test") is skipped. With the 4-entry list here, a non-UTF-8 project whose <sourceRoots> points to src and contains e.g. src/jvmTest or src/functionalTest stages it into utf8-sources/0/jvmTest (losing the src/ parent so hog then uploads it — verified by a JUnit test on 211887ec where Utf8Sources.copy([basedir/src], ISO_8859_1, ...) copied src/jvmTest/java/com/acme/AppTest.java).
Replacing TEST_SOURCE_SETS with name.equals("test") || name.equals("testFixtures") || name.endsWith("Test") covers androidTest, integrationTest, and all custom *Test source sets in one expression.
| return; | ||
| } | ||
| if (exitCode != 0) { | ||
| // A hog from before JVM source uploads rejects --kind jvm and --meta-out as a usage |
There was a problem hiding this comment.
Suggestion: Consider aligning the exit-code 2 and exit-code 3 hints here (lines 227–238) with hog >= 1.1.0 and companion PR #1012 (PostHogUploadJvmSourcesTask.kt:205-217).
Because versionProblem() (line 177) has already verified hog >= 1.1.0, an exit code 2 (EXIT_USAGE) is no longer from an outdated hog — it typically comes from an invalid setting like HOG_RELEASE_MODE or HOG_UPLOAD_CONCURRENCY (hog/src/commands/error-tracking/shared.ts:144-174), so pointing users to hog upgrade can mislead them. Similarly, exit code 3 (EXIT_NEEDS_PERSON, hog/src/core/errors.ts:51-65) also covers expired sessions, OIDC CI setup (hog ci setup), and missing scopes in addition to missing credentials.
Matching #1012's wording (pointing exit 2 at hog's output above and mentioning hog ci setup / re-login on exit 3) makes both failure paths clearer.
Source code for JVM server exceptions, in release order:
hog error-tracking process --kind jvm(merged)posthog-meta.propertiescom.posthog.jvm: upload the sources at build timeWhat each step waits for:
💡 Motivation and Context
Maven teams need a build step that uploads their sources and packages the upload's id, so error tracking shows code on the frames of exceptions
posthog-servercaptures. This addscom.posthog:posthog-maven-pluginwith one goal,upload-sources.hog error-tracking process --kind jvm(feat(cli): bundle and upload jvm sources with hog posthog#144749) inprocess-classes, after compilation, and writesposthog-meta.propertiesinto the classes directory. feat(server): read the map id and release id from posthog-meta.properties #1019 makes the SDK read it.<sourceDirs>ofkotlin-maven-plugin, which mixed Java and Kotlin projects use.additionalSourceRootsadds other modules' directories, andsourceRootsreplaces the defaults. Java sources in a non-UTF-8 encoding, also the platform default when none is set, are uploaded as UTF-8 copies. A file that is valid UTF-8 already stays as it is, so another module's UTF-8 sources keep their characters.posthog.hogExecutable. On Windows it runs the npm package'shog.exeinstead of the.cmdshim, so arguments never pass through cmd. A shim without that binary counts as no install, and a configured.cmdpath refuses values with cmd operators.releaseVersionoverrides it.mvn testandmvn installon a laptop never upload work in progress or need the network. Offline builds skip too.posthog-meta.propertiescould replace the application's on the classpath. An integration-test or distribution module that depends on the app does not make the app skip.hog --versionfirst and needs hog 1.1.0 or newer. An older hog gets "runhog upgrade". A posthog-cli install never runs the upload, and its warning gives the hog install commands.requireUploaduploads from every build, also a Dockerfile outside CI, and turns each of those problems into a failure.settings.gradle.kts, the release workflow, the Makefile and the pnpm workspace. The first release is 0.1.0.💚 How did you test it?
META-INF/maven/plugin.xmlfrom the built jar and checks the goal, phase, properties and dependencies Maven reads.additionalSourceRoots, and the umlauts show correctly. Before the fix in this PR, the app skipped too.kotlin-maven-pluginproject with<sourceDirs>and mixed Java and Kotlin.requireUploadwithout credentials fails the build.Earlier runs with posthog-cli, before the move to hog
target/generated-sources/annotations, and the fat jar carries the id.kotlin-maven-pluginsetups, and a multi-stage Docker build against a local PostHog.posthog-cli0.18.10 (too old),requireUpload, and a 113 MB bundle.📝 Checklist
If releasing new changes
pnpm changesetto generate a changeset fileThe changeset
.changeset/maven-plugin-upload-sources.md(minor) was written by hand in the same format.🤖 Agent context
Autonomy: Human-driven (agent-assisted)
hog upgrade.masteris 1.0.2, and its pending minor changeset makes the next release 1.1.0, whichHog.MIN_HOG_VERSIONalready requires.